import pymysql


db = pymysql.connect(user="devil", password="123456", database="dict")

cur = db.cursor()
sql = "select id,word,exp from mydict limit 50"
cur.execute(sql)

# get one result from cur
# one = cur.fetchone()
# print(one)

# get a series of result of cur
many = cur.fetchmany()
print(many)
cur.close()
db.close()
